package com.terrorism.sdk.utils;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.graphics.Point;
import android.os.Build;
import android.view.Display;
import android.view.WindowManager;

/**
 * @since Wednesday, June 25, 2014
 * @author hoangcaomobile
 *
 */
public class ScreenUtils {

	// get size of screen width
	@SuppressWarnings("deprecation")
	@SuppressLint("NewApi")
	public static int getScreenWidth(Activity mActivity) {
		int screenWidth = 0;  
		//		int screenHeight = 0;  
		Point size = new Point();
		WindowManager w = mActivity.getWindowManager();

		if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)    {
			w.getDefaultDisplay().getSize(size);
			screenWidth = size.x;
			//			screenHeight = size.y; 
		} else {
			Display d = w.getDefaultDisplay(); 
			screenWidth = d.getWidth(); 
			//			screenHeight = d.getHeight(); 
		}
		return screenWidth;

	}
	// --

	// get size of screen height
	@SuppressWarnings("deprecation")
	@SuppressLint("NewApi")
	public static int getScreenHeight(Activity mActivity) {
		int screenHeight = 0;  
		//		int screenHeight = 0;  
		Point size = new Point();
		WindowManager w = mActivity.getWindowManager();

		if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)    {
			w.getDefaultDisplay().getSize(size);
			screenHeight = size.y;
			//			screenHeight = size.y; 
		} else {
			Display d = w.getDefaultDisplay(); 
			screenHeight = d.getHeight(); 
			//			screenHeight = d.getHeight(); 
		}
		return screenHeight;

	}
	// --


}
